Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET 5 fix singlefile apps crashing on fetching app icon #164

Merged
merged 3 commits into from
Sep 4, 2021

Conversation

Insire
Copy link
Contributor

@Insire Insire commented Jul 3, 2021

Fixes #159

When a application using AdonisUI uses .net5 was compiled as

<SelfContained>true</SelfContained> and
<PublishSingleFile>true</PublishSingleFile>

then Assembly.GetEntryAssembly()?.ManifestModule.FullyQualifiedName won't return a valid filename.

I replaced that call with

Process.GetCurrentProcess().MainModule.FileName

and also added a check for the returned path actually pointing to a valid file, just in case things change again in the future.

@Insire Insire mentioned this pull request Jul 3, 2021
@Insire
Copy link
Contributor Author

Insire commented Jul 24, 2021

Is there anything i can do, to get this merged?

@benruehl
Copy link
Owner

Thanks for contributing!
Sorry it took me so long to look at your changes.
It seems that this doesn't quite work though. The demo app has no icon anymore.
Which makes sense because if the file path is found null is returned.

@Insire
Copy link
Contributor Author

Insire commented Jul 31, 2021

Hi, thanks for taking a look at this.

There was indeed a bug here. I've updated the PR accordingly. Could you take a look again?

Also can you clarify what Demo-App and Icon you were referring to? Even with my most recent changes, i fail to find the difference, that should be visibile, in the AdoniUI.Demo?

@benruehl
Copy link
Owner

Thanks for updating, I'll take a look.

And yes, I am referring to the AdonisUI.Demo app. By default, you don't see it because the title bar is in the PlaceTitleBarOverContent mode. In order to see it, you need to start the app and enable the "Title bar" setting in the top left corner. This brings up the default title bar which then has no icon like it had before the changes.

@Insire
Copy link
Contributor Author

Insire commented Jul 31, 2021

I see, that makes sense. Seems to be working then, from what i can tell:

grafik

@benruehl benruehl merged commit 0d4db53 into benruehl:master Sep 4, 2021
@Insire Insire deleted the FixExtractAssociatedIcon branch September 5, 2021 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Application fails to start when published as a single file
2 participants